package com.sc.nft.mapper;

import com.sc.nft.dto.TemporarilyDTO;
import com.sc.nft.entity.UserEcologyReforgeUpperLimit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.UserEcologyReforgeUpperLimitDetails;
import com.sc.nft.entity.vo.ecology.AdminUserEcologyReforgeUpperLimitDetailsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 生态-用户重铸上限表(sc_user_ecology_reforge_upper_limit)数据Mapper
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2024-06-07 09:04:10
 */
@Mapper
public interface UserEcologyReforgeUpperLimitMapper extends BaseMapper<UserEcologyReforgeUpperLimit> {

    /**
     * 用户重铸上限详情
     *
     * @param userTel
     * @return
     */
    List<AdminUserEcologyReforgeUpperLimitDetailsVO> userEcologyReforgeUpperLimitDetails(@Param("userTel") String userTel);

    /**
     * 减少重铸上限
     *
     * @param userId
     * @param collectionId
     * @param count
     * @return
     */
    boolean subCountByUserIdAndCollectionId(@Param("userId") Long userId, @Param("collectionId") Long collectionId, @Param("count") Integer count);

    /**
     * 批量入库
     *
     * @param list
     * @return
     */
    Integer saveList(@Param("list") List<UserEcologyReforgeUpperLimit> list);

    /**
     * 批量入库
     *
     * @param list
     * @return
     */
    Integer saveTemporarilyDTOList(@Param("list") List<TemporarilyDTO> list);

    boolean subNewCountByUserIdAndCollectionId(@Param("userId") Long userId, @Param("collectionId") Long collectionId, @Param("count") Integer count, @Param("usableCount") Integer usableCount);
}
